<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" th:src="@{/user/js/jquery.min.js}"></script>
<script type="text/javascript">
    function adduser(){
        $.ajax({
            url:"http://localhost:9003/user/userserver/addUser",
            type:"post",
            dataType:"json",
            data:{
                "username":$("#username").val(),
                "password":$("#password").val(),
                "phone":$("#phone").val()
            },
            success:function(data){
                console.log(data);
                window.location.href="http://localhost:9003/user/showlogin";
            }
        });
    }
</script>
</head>
<body>
<form id="userform">
    <label>用户名:</label><input type="text" id="username"/><br/>
    <label>密码:</label><input type="password" id="password"/><br/>
    <label>电话:</label><input type="text" id="phone"/>
</form><br/>
<button type="button" onclick="adduser()">提交</button>
</body>
</html>